export default class BaseModel {

    constructor() {
        this.attributeValues = {};
        this.attributes = [];
    }

    get AttributeValues() {
        return this.attributeValues;
    }

    get Attributes() {
        return this.attributes;
    }

    setAttribute(name, value) {
        if(name in this.attributeValues) {
            this.attributeValues[name] = value;
        }
    }

    setAttributes(attrs) {
        for(let key in attrs) {
            this.setAttribute(key, attrs[key]);
        }
    }

    getAttribute(name) {
        return this.attributeValues[name];
    }

    removeAttribute(name) {
        const value = this.getAttribute(name);
        delete this.attributeValues[name];
        return value;
    }
}